home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Carousel
/
CAROUSEL.cdr
/
mactosh
/
utilprn
/
hpdeskje.sit
/
HPDJet ƒ
/
procedures_for_PDEF1.c
< prev
next >
Wrap
Text File
|
1989-04-02
|
2KB
|
73 lines
/* 02.04.1989 amn (latest edit) */
/* procedures_for_PDEF1.c - printer driver for Macintosh and HP DeskJet, procedures */
/* common to PDEF0 and PDEF1. */
/* Authors: Ari Mujunen (amn@hutcs.hut.fi) and Olli Arnberg (oar@hutcs.hut.fi). */
/* Copyright Ari Mujunen, Olli Arnberg 1989. */
/* You may redistribute the driver (=printer resource file, source files, */
/* documentation file(s), and the file 'Copyright and Source Offer') */
/* only _non-commercially_ and _in its entirety_. */
/* See the file 'Copyright and Source Offer' and/or documentation for details. */
/* Acknowledgements: Special thanks to Mr. Earle R. Horton for his 'Daisy' */
/* daisywheel printer driver and its source code published in 'MacTutor', Nov-Dec 1987. */
/* This driver served as a basis and inspiration for our work. It also */
/* proofed that a Macintosh printer driver can be done despite the lack of */
/* documentation from Apple. */
/* Change history: */
/* Version When Who Why */
/* 2.1 02.04.1989 amn,oar Released version. */
/* Reinitializes grafPort's rectangles and regions according to the print record. */
void setRectsAndRgns(TPPrPort, THPrint);
void
setRectsAndRgns(thisPort, hPrint)
TPPrPort thisPort;
THPrint hPrint;
{
/* GrafDevice(?); should be '(*hPrint)->prInfoPT.iDev | prStl.wDev&0xFF' */
{ /* This printing port has no bitmap to draw into. */
/* If it had, it would reflect DeskJet's capabilities (print area). */
BitMap bm;
bm.baseAddr = nil;
bm.rowBytes = 0;
bm.bounds.top = 0;
bm.bounds.left = 0;
bm.bounds.bottom = 0;
bm.bounds.right = 0;
SetPortBits(&bm);
}
/* Set the port rectangle to the page rectangle (IM II-150). */
thisPort->gPort.portRect = (*hPrint)->prInfo.rPage;
/* 'visRgn' should be a region of the previous rectangle. */
RectRgn(
thisPort->gPort.visRgn,
&thisPort->gPort.portRect
);
/* 'clipRgn' should be set to the page rectangle (IM II-150). */
ClipRect(&thisPort->gPort.portRect);
/* Now we move the page rectangle to compensate HP DeskJet's physical */
/* differences when compared to Applewriters. */
/* This moves drawing relative to the bitmap. */
{
ptXprintGlobals xPrintGlobals;
xPrintGlobals = GET_XPRINT_GLOBALS;
MovePortTo(
-((*hPrint)->rPaper.left + xPrintGlobals->currentSettings.printerOrigin.h),
-((*hPrint)->rPaper.top + xPrintGlobals->currentSettings.printerOrigin.v)
);
}
} /* setRectsAndRgns */